﻿using System;
using System.Text;
using System.Collections.Generic;
using Microsoft.VisualStudio.TestTools.UnitTesting;

namespace Gebra.Test
{
    [TestClass]
    public class VariableTest
    {
        [TestMethod]
        public void Construct()
        {
            new Variable();
        }

        [TestMethod]
        [ExpectedException(typeof(ArgumentNullException))]
        public void SetValueWithNull()
        {
            var variable = new Variable();
            variable.SetValue(a_value: null);
        }

        [TestMethod]
        public void SetValueToNumber()
        {
            var variable = new Variable();
            variable.SetValue((Number) 25);

            var result = variable.Evaluate() as Number;

            Assert.IsNotNull(result);
            Assert.AreEqual(25, (double)result);
        }
    }
}
